document.addEventListener('alpine:init', () => {
  Alpine.data('users', () => {
    return {
      data: [],
      init() {
        this.getUsers();
      },
      getUsers() {
        fetch('https://jsonplaceholder.typicode.com/users')
          .then((response) => response.json())
          .then((json) => (this.data = json));
      },
    };
  });
});
